import React, { Component } from 'react';
import { BrowserRouter as Router, Switch, Route, Redirect } from 'react-router-dom'
import Login from '../pages/Login'
import Detail from '../pages/Detail'
import Search from '../pages/Search'
import Home from '../pages/Home'
import NotMatch from '../pages/NotMatch'
class Index extends Component {
	render() {
		return (
			<Router>
				<Switch>
					<Route path="/login" component={ Login }></Route>
					<Route path="/detail" component={ Detail }></Route>
					<Route path="/search" component={ Search }></Route>
					<Route path="/home" component={ Home }></Route>
					{/* 重定向 */}
					<Redirect from="/" to='/home' exact></Redirect>
					{/* 404  */}
					<Route component={ NotMatch }></Route>
				</Switch>
			</Router>
		);
	}
}

export default Index;
